package com.ibeeking.found.common.enums;

/**
 * @Author ibeeking
 * @Date: 2019-04-26 16:04
 * @Description:
 */
public enum FrontendTypeEnum {
    GLOBAL("global", "全局端"),
    TENANT("tenant", "租户端"),
    SHOP("shop", "商户端"),
    PLANT("plant", "工厂端"),
    STOCK("stock", "仓库端"),
    DELIVERY("delivery", "配送端"),
    VENDOR("vendor", "供应商端"),
    CP("cp", "微应用端"),
    APPLETS("applets", "小程序端"),
    APP("app", "手机APP端"),
    H5("h5", "H5端"),
    CUSTOMER_SERVICE("cs", "客服端"),
    ;

    private String code;
    private String name;

    FrontendTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getNameByCode(String code) {
        for (FrontendTypeEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj.getName();
            }
        }
        return null;
    }
}
